package com.credit.service;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.entity.CreditGrabOrder;
import com.credit.repository.CreditGrabOrderDao;

@Service("creditGrabOrderService")
@Transactional
public class CreditGrabOrderService {
	@Autowired
	private CreditGrabOrderDao creditGrabOrderDao;

	public void addGrabOrder(CreditGrabOrder grabOrder) {
		
		creditGrabOrderDao.save(grabOrder);
		
	}

	public CreditGrabOrder findByManagerIdAndLoanId(Long managerId, Long loanId, Integer processflag) {
		
		return creditGrabOrderDao.findByManagerIdAndLoanId(managerId,loanId,processflag);
	}

	public List<CreditGrabOrder> findByManagerIdAndLoanId(Long id, Long loanId) {
		
		return creditGrabOrderDao.findByManagerIdAndLoanId(id, loanId);
	}

}
